home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / mach / ds5000.md / compatSig.h < prev    next >
C/C++ Source or Header  |  1990-06-26  |  3KB  |  116 lines

  1. /*
  2.  * compatSig.h --
  3.  *
  4.  *    Declarations of mapping tables between Sprite and UNIX signals.
  5.  *    This used to be compatSig.c but now it shared between kernel and
  6.  *    user compatibility libraries.
  7.  *
  8.  * Copyright 1986, 1988 Regents of the University of California
  9.  * Permission to use, copy, modify, and distribute this
  10.  * software and its documentation for any purpose and without
  11.  * fee is hereby granted, provided that the above copyright
  12.  * notice appear in all copies.  The University of California
  13.  * makes no representations about the suitability of this
  14.  * software for any purpose.  It is provided "as is" without
  15.  * express or implied warranty.
  16.  *
  17.  * $Compat: proto.h,v 1.3 86/02/14 09:47:40 ouster Exp $ SPRITE (Berkeley)
  18.  */
  19.  
  20. #ifndef _COMPATSIG
  21. #define _COMPATSIG
  22.  
  23. #include "sprite.h"
  24. /*
  25.  * Define the mapping between Unix and Sprite signals. There are two arrays,
  26.  * one to go from Unix to Sprite and one to go from Sprite to Unix.
  27.  *
  28.  * Note that the signals SIGIOT and SIGEMT that people don't usually
  29.  * send from the keyboard and that tend not to be delivered by the
  30.  * kernel but, rather, are used for IPC have been mapped to user-defined
  31.  * signal numbers, rather than a standard Sprite signal. This allows more
  32.  * of a one-to-one mapping.
  33.  */
  34.  
  35. /*
  36.  * Map Unix signals to Sprite signals.
  37.  */
  38. int compat_UnixSigToSprite[] = {
  39.             NULL,
  40.      /* SIGHUP */    SIG_INTERRUPT,
  41.      /* SIGINT */    SIG_INTERRUPT,
  42.      /* SIGDEBUG */    SIG_DEBUG,    
  43.      /* SIGILL */    SIG_ILL_INST,
  44.      /* SIGTRAP */    SIG_DEBUG,
  45.      /* SIGIOT */    28,
  46.      /* SIGEMT */    29,
  47.      /* SIGFPE */    SIG_ARITH_FAULT,
  48.      /* SIGKILL */    SIG_KILL,
  49.      /* SIGMIG */    SIG_MIGRATE_TRAP,
  50.      /* SIGSEGV */    SIG_ADDR_FAULT,
  51.      /* SIGSYS */    NULL,
  52.      /* SIGPIPE */    SIG_PIPE,
  53.      /* SIGALRM */    SIG_TIMER,
  54.      /* SIGTERM */    SIG_TERM,
  55.      /* SIGURG */    SIG_URGENT,
  56.      /* SIGSTOP */    SIG_SUSPEND,
  57.      /* SIGTSTP */    SIG_TTY_SUSPEND,
  58.      /* SIGCONT */    SIG_RESUME,
  59.      /* SIGCHLD */    SIG_CHILD,
  60.      /* SIGTTIN */    SIG_TTY_INPUT,
  61.      /* SIGTTOU */    SIG_TTY_OUTPUT,
  62.      /* SIGIO */    26,
  63.      /* SIGXCPU */    NULL,
  64.      /* SIGXFSZ */    NULL,
  65.      /* SIGVTALRM */    NULL,
  66.      /* SIGPROF */    NULL,
  67.      /* SIGWINCH */    27,
  68.      /* SIGMIGHOME */    SIG_MIGRATE_HOME,
  69.      /* SIGUSR1 */    30,    /* user-defined signal 1 */
  70.      /* SIGUSR2 */    31,    /* user-defined signal 1 */
  71.      /* NULL */        32,    /* not a signal, but NSIG is 32 so we need
  72.                          an entry here. */
  73. };
  74.  
  75. /*
  76.  * Map Sprite signals to Unix signals.
  77.  */
  78. static int spriteToUnix[] = {
  79.                 NULL,
  80.     /* SIG_DEBUG */        SIGDEBUG,
  81.     /* SIG_ARITH_FAULT */    SIGFPE,
  82.     /* SIG_ILL_INST */        SIGILL,
  83.     /* SIG_ADDR_FAULT */    SIGSEGV,
  84.     /* SIG_KILL */        SIGKILL,
  85.     /* SIG_INTERRUPT */        SIGINT,
  86.     /* SIG_BREAKPOINT */    SIGILL,
  87.     /* SIG_TRACE_TRAP */    SIGILL,
  88.     /* SIG_MIGRATE_TRAP */    SIGMIG,
  89.     /* SIG_MIGRATE_HOME */    SIGMIGHOME,
  90.     /* SIG_SUSPEND */        SIGSTOP,
  91.     /* SIG_RESUME */        SIGCONT,
  92.     /* SIG_TTY_INPUT */        SIGTTIN,
  93.     /* SIG_PIPE */        SIGPIPE,
  94.     /* SIG_TIMER */        SIGALRM,
  95.     /* SIG_URGENT */        SIGURG,
  96.     /* SIG_CHILD */        SIGCHLD,
  97.     /* SIG_TERM */        SIGTERM,
  98.     /* SIG_TTY_SUSPEND */    SIGTSTP,
  99.     /* SIG_TTY_OUTPUT */    SIGTTOU,
  100.     /* 21 */            NULL,
  101.     /* 22 */            NULL,
  102.     /* 23 */            NULL,
  103.     /* 24 */            NULL,
  104.     /* 25 */             NULL,
  105.     /* 26 */            SIGIO,
  106.     /* 27 */            SIGWINCH,
  107.     /* 28 */            SIGIOT,
  108.     /* 29 */            SIGEMT,
  109.     /* 30 */            SIGUSR1,
  110.     /* 31 */            SIGUSR2,
  111.     /* 32 */            NULL,
  112. };
  113.  
  114.  
  115. #endif
  116.